package com.wzj.yygh.common.exception;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 自定义全局异常类
 *
 * @author qy
 */
@Data
@ApiModel(value = "自定义全局异常类")
@NoArgsConstructor
@AllArgsConstructor
public class YyghException extends RuntimeException {

    @ApiModelProperty(value = "异常信息")
    private String msg;
    @ApiModelProperty(value = "异常状态码")
    private Integer code;
    /**
     * 接收枚举类型对象
     */
    public YyghException(Integer code,String msg,Exception e) {
        super(e);
        this.code = code;
        this.msg = msg;
    }
}
